home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 23 / CU Amiga - Super CD-ROM 23 (June 1998).iso / CreatingGames / Utilities / Misc / GMS / GMSDev / Includes / dpkernel / dpkernel.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-12-08  |  5.3 KB  |  179 lines

  1. #ifndef DPKERNEL_H
  2. #define DPKERNEL_H TRUE
  3.  
  4. /*
  5. **   $VER: dpkernel.h V0.9B
  6. **
  7. **   General include file for programs using the Games Master System.
  8. **
  9. **   (C) Copyright 1996-1997 DreamWorld Productions.
  10. **       All Rights Reserved.
  11. */
  12.  
  13. #ifndef SYSTEM_TYPES_H
  14. #include <system/types.h>
  15. #endif
  16.  
  17. #ifndef SYSTEM_REGISTER_H
  18. #include <system/register.h>
  19. #endif
  20.  
  21. /***************************************************************************/
  22.  
  23. #define DPKVersion  0
  24. #define DPKRevision 9
  25.  
  26. #define SKIPENTRY   0
  27. #define ENDLIST     -1
  28. #define LISTEND     -1
  29. #define TAGEND      0
  30. #define DEFAULT     0
  31.  
  32. #define TBYTE       0L
  33. #define TLONG       (1L<<31)
  34. #define TWORD       (1L<<30)
  35. #define TAPTR       (1L<<29)|TLONG
  36. #define TSTEPIN     (1L<<28)
  37. #define TSTEPOUT    (1L<<27)
  38. #define TTRIGGER    (1L<<26)
  39.  
  40. #ifndef TAG_IGNORE
  41. #define TAG_IGNORE  (1L)
  42. #define TAG_MORE    (2L)
  43. #define TAG_SKIP    (3L)
  44. #endif
  45.  
  46. #define JMP_DEFAULT 0L  /* Default jump table */
  47. #define JMP_LVO     1L  /* LVO jump type (standard) */
  48. #define JMP_AMIGAE  2L  /* Amiga E jump table */
  49.  
  50. #define GET_NOTRACK 0x00010000L
  51.  
  52. #define DMsg(a) DebugMessage(DBG_Message,a)
  53. #define EMsg(a) DebugMessage(DBG_Error,a)
  54.  
  55. /****************************************************************************
  56. ** Header used for all objects.
  57. */
  58.  
  59. struct Head {
  60.   WORD   ID;
  61.   WORD   Version;
  62.   struct SysObject *Class;
  63.   struct Stats     *Stats;
  64. };
  65.  
  66. /* The Stats structure is private to the system, and is handled by Get() */
  67.  
  68. struct Stats {
  69.   LONG Key;             /* Resource tracking key */
  70.   APTR ChildPrivate;    /* Reserved pointer for use by child objects */
  71.   LONG Flags;           /* General flags */
  72. };
  73.  
  74. #define ST_LOCK 0x00000001  /* Set if the object is currently locked */
  75.  
  76. /****************************************************************************
  77. ** Raw Data object.
  78. */
  79.  
  80. #define RAWVERSION   1
  81. #define TAGS_RAWDATA ((ID_SPCTAGS<<16)|ID_RAWDATA)
  82.  
  83. struct RawData {
  84.   struct Head Head;  /* Standard structure header */
  85.   LONG   Size;       /* Size of the data in bytes */
  86.   APTR   Data;       /* Pointer to the data */
  87.  
  88.   /*** Private flags below ***/
  89.  
  90.   BYTE prvAFlags;    /* Private */
  91.   BYTE prvPad;       /* Private */
  92. };
  93.  
  94. /****************************************************************************
  95. ** Universal errorcodes returned by certain functions.
  96. */
  97.  
  98. #define ERR_OK           0  /* Function went OK (also NULL) */
  99. #define ERR_NOMEM        1  /* Not enough memory available */
  100. #define ERR_NOPTR        2  /* Required pointer not present */
  101. #define ERR_INUSE        3  /* Previous allocations have not been freed */
  102. #define ERR_STRUCT       4  /* Structure version not supported or not found */
  103. #define ERR_FAILED       5  /* General failure */
  104. #define ERR_FILE         6  /* File error, eg file not found */
  105. #define ERR_DATA         7  /* There is an error in the given data */
  106. #define ERR_SEARCH       8  /* A search routine in this function failed */
  107. #define ERR_SCRTYPE      9  /* Screen type not recognised */
  108. #define ERR_MODULE      10  /* Trouble initialising/using a module */
  109. #define ERR_RASTCOMMAND 11  /* Invalid raster command detected */
  110. #define ERR_RASTERLIST  12  /* Complete rasterlist failure */
  111. #define ERR_NORASTER    13  /* Expected rasterlist is missing from Screen */
  112. #define ERR_DISKFULL    14  /* Disk full error */
  113. #define ERR_FILEMISSING 15  /* File not found */
  114. #define ERR_WRONGVER    16  /* Wrong version or version not supported */
  115. #define ERR_MONITOR     17  /* Monitor driver not found or cannot be used */
  116. #define ERR_UNPACK      18  /* Problem with unpacking of data */
  117. #define ERR_ARGS        19  /* Invalid arguments passed to function */
  118. #define ERR_NODATA      20  /* No data is available for use */
  119. #define ERR_READ        21  /* Error reading data from file */
  120. #define ERR_WRITE       22  /* Error writing data to file */
  121. #define ERR_LOCK        23  /* Could not obtain lock on object */
  122. #define ERR_EXAMINE     24  /* Could not examine directory or file */
  123. #define ERR_LOSTCLASS   25  /* This object has lost its class reference */
  124. #define ERR_NOACTION    26  /* This object does not support the required action */
  125. #define ERR_NOSUPPORT   27  /* Object does not support the given data */
  126. #define ERR_MEMORY      28  /* General memory error */
  127.  
  128. /****************************************************************************
  129. ** Memory types used by AllocMemBlock().  This is generally identical to the
  130. ** exec definitions but CHIP is renamed to VIDEO (displayable memory) and
  131. ** there is an addition of BLIT and SOUND specific memory.
  132. */
  133.  
  134. #define MEM_DATA      0
  135. #define MEM_PRIVATE   (1L<<0)
  136. #define MEM_VIDEO     (1L<<1)
  137. #define MEM_BLIT      (1L<<2)
  138. #define MEM_SOUND     (1L<<3)
  139. #define MEM_CODE      (1L<<4)
  140. #define MEM_UNTRACKED (1L<<31)
  141.  
  142. #define AllocPrivate(size,flags) AllocMemBlock((size),(flags)|MEM_PRIVATE)
  143.  
  144. /***************************************************************************/
  145.  
  146. #ifndef SYSTEM_MISC_H
  147. #include <system/misc.h>
  148. #endif
  149.  
  150. #ifndef SYSTEM_MODULES_H
  151. #include <system/modules.h>
  152. #endif
  153.  
  154. #ifndef GRAPHICS_BLITTER_H
  155. #include <graphics/blitter.h>
  156. #endif
  157.  
  158. #ifndef GRAHICS_PICTURES_H
  159. #include <graphics/pictures.h>
  160. #endif
  161.  
  162. #ifndef GRAPHICS_SCREENS_H
  163. #include <graphics/screens.h>
  164. #endif
  165.  
  166. #ifndef INPUT_JOYPORTS_H
  167. #include <input/joyports.h>
  168. #endif
  169.  
  170. #ifndef SOUND_SOUND_H
  171. #include <sound/sound.h>
  172. #endif
  173.  
  174. #ifndef FILES_FILES_H
  175. #include <files/files.h>
  176. #endif
  177.  
  178. #endif /* DPKERNEL_H */
  179.